$OpenBSD: patch-tests_Makefile,v 1.6 2017/02/28 11:32:16 dcoppa Exp $

- Ensure the libraries needed by libregress.so can also be located and are preloaded.

--- tests/Makefile.orig	Tue Feb 28 11:55:06 2017
+++ tests/Makefile	Tue Feb 28 11:57:01 2017
@@ -26,7 +26,7 @@ endif
 endif
 
 PKGS = gio-2.0 cairo cairo-gobject gobject-introspection-1.0 gmodule-2.0 libffi
-LUA = lua
+LUA = ${MODLUA_BIN}
 PKG_CONFIG = pkg-config
 
 ifndef CFLAGS
@@ -55,7 +55,7 @@ clean :
 	rm -f $(REGRESS) $(REGRESS_OBJS) Regress-1.0.gir Regress-1.0.typelib
 
 check : all
-	cd .. && LD_LIBRARY_PATH=tests:$$LD_LIBRARY_PATH \
+	cd .. && LD_PRELOAD=/usr/lib/libpthread.so LD_LIBRARY_PATH=tests:$$LD_LIBRARY_PATH \
 	    GI_TYPELIB_PATH=tests:$$GI_TYPELIB_PATH \
 	    LUA_PATH=./?.lua\;`$(LUA) -e "print(package.path)"` \
 	    LUA_CPATH=./?.so\;`$(LUA) -e "print(package.cpath)"` \
@@ -76,7 +76,7 @@ Regress-1.0.gir : $(REGRESS)
 	  --namespace=Regress --nsversion=1.0				\
 	  --include=cairo-1.0 --include=Gio-2.0				\
 	  --library-path=/usr/lib --library-path=/usr/X11R6/lib		\
-	  --library-path=/usr/local/lib					\
+	  --library-path=${LOCALBASE}/lib				\
 	  $(GIDATADIR)/regress.c $(GIDATADIR)/regress.h			\
 	 -lregress
 
